/* UBBC 监控面板样式 */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --sidebar-width: 250px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark-color);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    text-align: center;
    padding: 0 20px 30px;
    border-bottom: 1px solid #495057;
}

.logo h2 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
}

.nav-item:hover {
    background-color: #495057;
}

.nav-item.active {
    background-color: var(--primary-color);
}

.nav-icon {
    margin-right: 10px;
    font-size: 18px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    background-color: white;
}

.main-content h1 {
    margin-bottom: 30px;
    color: var(--dark-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* 仪表盘网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.metric-card h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.metric-value.violations {
    color: var(--danger-color);
}

.metric-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* 状态指示器 */
.status-indicator {
    display: flex;
    align-items: center;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.online {
    background-color: var(--success-color);
}

/* 图表容器 */
.chart-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-container h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

/* Tab 内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* 规则管理 */
.rules-section {
    margin-top: 20px;
}

.rules-list {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background-color: #f8f9fa;
}

/* 日志查看 */
.logs-section {
    margin-top: 20px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.logs-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background-color: #f8f9fa;
    max-height: 600px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
}

.close {
    color: var(--secondary-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--dark-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        display: flex;
        overflow-x: auto;
    }

    .nav-item {
        white-space: nowrap;
    }
}
